#!/bin/bash

if [ -n "$2" ]; then
    export APP_NAME="$2"
    echo "Update app name to ${APP_NAME}"
fi

if [ -n "$3" ]; then
    export APP_VERSION="$3"
    echo "Update app version to ${APP_VERSION}"
fi

# prepare build - source for environment variable update
source /build/bin/prepare_package_build $@

# generate metadata
dh_make -n -s --yes

# copy generated metadata to app folder
cp -R $BUILD_FOLDER/debian "${APP_SRC}"
